package waysing.cream.vo;

import org.thymeleaf.expression.Maps;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 作者 E-mail:weixinXie 274604559@qq.com
 * @version 创建时间：2018\3\15 0015 9:54
 * @describe 作者很懒，什么都没留下
 */
public class ReturnFormat {
    public static Map<Integer,String> messageMap = new HashMap<Integer, String>(32);
    public static int INDEX_OUT_OF_BOUNDS = 1005;
    public static int OK = 200;
    //初始化状态码与文字说明
    static {
        messageMap.put(INDEX_OUT_OF_BOUNDS, "[服务器]数组越界异常");
        messageMap.put(OK, null);
    }
    //状态码
    private Integer staus;
    //状态解释
    private String message;
    //返回数据
    private Object data;

    public ReturnFormat() {
    }

    public ReturnFormat(Integer staus, String message, Object data) {
        this.staus = staus;
        this.message = message;
        this.data = data;
    }

    public static ReturnFormat getReturnFormat(int status, String message, Object data) {
        ReturnFormat returnFormat = new ReturnFormat(status, message,data);
        return returnFormat;
    }

    public Integer getStaus() {
        return staus;
    }

    public void setStaus(Integer staus) {
        this.staus = staus;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
